export default function(sequelize, DataTypes) {
  return sequelize.define('depot_record', {
    id: {
      autoIncrement: true,
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "主键"
    },
    goods_id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      comment: "物品id"
    },
    amount: {
      type: DataTypes.DECIMAL(20,2),
      allowNull: true,
      comment: "数量"
    },
    is_out: {
      type: DataTypes.TINYINT,
      allowNull: false,
      comment: "买入还是卖出 0买入 1卖出"
    },
    create_time: {
      type: DataTypes.CHAR(13),
      allowNull: false,
      comment: "创建时间"
    },
    remark: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "备注"
    },
    is_delete: {
      type: DataTypes.TINYINT,
      allowNull: true,
      comment: "逻辑删除 0 没有删除 1删除"
    }
  }, {
    sequelize,
    tableName: 'depot_record',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
